﻿using Cloud.Core.AuthUser;
using Cloud.Core.Bizlogic;
using Cloud.Core.Model;
using Cloud.Core.ModelSearch;
using Cloud.Core.Response;
using Microsoft.AspNetCore.Mvc;
using Senparc.Weixin.WxOpen.AdvancedAPIs.Sns;
using System.Net.Http;
using System.Threading.Tasks;
using System;
using Cloud.Core.Model.Promotion;
using Microsoft.EntityFrameworkCore;
using System.Linq;
using Microsoft.EntityFrameworkCore.Internal;
using System.Collections.Generic;

namespace Cloud.Core.Controllers.WebChat
{

    /// <summary>
    /// 用户管理
    /// </summary> 
    [Route("api/wx/[controller]")]
    [ApiController]
    public class PromotionsUserTypeController : ControllerBase
    {
        private readonly CloudDataBase _context;
        private readonly ModOperate.Mod _thisModel = ModOperate.Mod.MBasicInfo;
        private readonly HttpClient _httpClient;
        public PromotionsUserTypeController(CloudDataBase context, HttpClient httpClient)
        {
            _context = context;
            _httpClient = httpClient;
        }



        /// <summary>
        /// 获取商户类型信息
        /// </summary>
        /// <returns></returns>
        [Route("GetList")]
        [HttpGet]
        public async Task<JsonResponse<List<PromotionsUserType>>> GetList(string temp)
        {
            var list = await _context.PromotionsUserType.Where(t => 1 == 1).ToListAsync();
            return new JsonResponse<List<PromotionsUserType>>
            {
                Data = list,
                Msg = "获取成功",
                Status = ResponseStatus.Success
            };

        }

    }
}
